package com.bwie.remote.focaty;

import com.bwie.common.domain.request.LoginRequest;
import com.bwie.common.domain.response.UserInfo;
import com.bwie.common.exctption.BizException;
import com.bwie.common.result.Result;
import com.bwie.remote.SysUserRemote;
import org.springframework.cloud.openfeign.FallbackFactory;

/**
 * 熔断
 * @author <a href="mailto:2891704036@qq.com">zhiyuheng</a>
 * @version 1.0
 * @description:
 * @date 2025/8/28 9:12
 */
public class SysUserRemoteFallback implements FallbackFactory<SysUserRemote> {
    @Override
    public SysUserRemote create(Throwable cause) {
        return new SysUserRemote() {
            @Override
            public Result<UserInfo> findByPhoneAndPassword(LoginRequest loginRequest) {
                throw new BizException("服务器繁忙，请稍后再试");
            }
        };
    }
}
